<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
     <script src="../../js/vue.js"></script>
     <style>
        .a{
            border: 1px solid blue;
        }
        .b{
            padding: 15px;
        }
    </style>
</head>
<body>
<div id="a">

    <h3>设置单值属性</h3>
    <a v-bind:href="url">{{url}}</a>
    <h3>设置数组语法</h3>
    <a v-bind:href="url"
       v-bind:class="['a','b']">{{url}}</a>
    <h3>设置对象语法</h3>
    <a v-bind:href="url"
       v-bind:class="{a:aFlag,b:bFlag}">{{url}}</a>

<!--    语法糖 v-bind=> : -->
    <a v-bind:href="url"
       :style="{color:'greed',fontSize:fsize}">{{url}}</a>

    <h3>设置函数语法</h3>
    <a v-bind:href="url"
        :style = "mystyle()">{{url}}</a>

    <a v-bind:href="url"
       :style="mystyle1()">{{url}}</a>

    <a v-bind:href="url"
       :style = "mystyle2()">{{url}}</a>
</div>
<script>
  var v = new Vue({
    el:"#a",
    data:{
      url:"index.html",
        aFlag:true,
        bFlag:false,
        fsize:"2em"

    },
      methods:{
        //非箭头函数
          mystyle:function (){
              return{color:'red',fontsize:this.fsize};
          },
          mystyle1:function (){
              return{color:'blue',fontsize:this.fsize};
          },
          mystyle2:function (){
              return{color:'yellow',fontsize:this.fsize};
          },
      }
  });
</script>
</body>
</html>